<section id="content">

    <h2 class="article">{if isset($personne)}{#MODIFIER#} {$personne->getPrenom()} {$personne->getNom()}{else}{#NOUVELLE_PERSONNE#}{/if}</h2>

    <form class="article buttons" name="formulaire" action="?action={if isset($personne)}modifierPersonne{else}ajouterPersonne{/if}" method="post">

        <input type="hidden" name="id" value="{if isset($personne)}{$personne->getId()}{/if}" />



        <fieldset class="form-text break">
            <label>{#TITRE#}<em>*</em></label>
            <select name="titre">
        {if (isset($personne)) AND ($personne->getTitre() eq 'Monsieur')}}<option value="Monsieur" selected="selected">{else}<option value="Monsieur">{/if}{#MONSIEUR#}</option>
{if (isset($personne)) AND ($personne->getTitre() eq 'Madame')}}<option value="Madame" selected="selected">{else}<option value="Madame">{/if}{#MADAME#}</option>
{if (isset($personne)) AND ($personne->getTitre() eq 'Mademoiselle')}}<option value="Mademoiselle" selected="selected">{else}<option value="Mademoiselle">{/if}{#MADEMOISELLE#}</option>
</select>
</fieldset>

<fieldset class="form-text">
    <label>{#NOM#}<em>*</em></label>
    <input type="text" name="nom" value="{if isset($personne)}{$personne->getNom()}{/if}" id="nom" class="validate[required,custom[onlyLetter],length[0,100]] text-input"/>
</fieldset>

<fieldset class="form-text">
    <label>{#PRENOM#}<em>*</em></label>
    <input type="text" name="prenom" value="{if isset($personne)}{$personne->getPrenom()}{/if}" id="prenom" class="validate[required,custom[onlyLetter],length[0,100]] text-input"/>
</fieldset>

<fieldset class="form-text">
    <label>{#TELEPHONE#}<em>*</em></label>
    <input type="text" name="telephone" value="{if isset($personne)}{$personne->getTelephone()}{/if}" id="telephone" class="validate[required,custom[telephone]] text-input"/>
</fieldset>

<fieldset class="form-text">
    <label>{#TELEPHONE2#}</label>
    <input type="text" name="telephonesecond" value="{if isset($personne)}{$personne->getTelephonesecond()}{/if}" id="telephone2" class="validate[optional,custom[telephone]] text-input"/>

</fieldset>

<fieldset class="form-text">
    <label>{#EMAIL#}</label>
    <input type="text" name="email" value="{if isset($personne)}{$personne->getEmail()}{/if}" id="email" class="validate[optional,custom[email]] text-input" />

</fieldset>

<fieldset class="form-text">
    <label>{#ROLE#}</label>
    <select name="role" id="role">
        <option value="" selected="selected">---</option>
        {if isset($listeRoles)}{foreach from=$listeRoles item=role }
        <option value="{$role->getNom()}">{$role->getNom()}</option>
        {/foreach}
        {/if}
    </select>
</fieldset>

<fieldset class="form-text">
    <label>{#ATTEST_FISCALE#}</label>
    <select name="attestationFiscale" id="attestationFiscale" class="validate[optional]">
{if (isset($personne)) AND ($personne->getAttestationFiscale() eq 1)}}<option value="1" selected="selected">{else}<option value="1">{/if}{#OUI#}</option>
{if (isset($personne)) AND ($personne->getAttestationFiscale() eq 0)}}<option value="0" selected="selected">{else}<option value="0">{/if}{#NON#}</option>
</select>
</fieldset>

<fieldset class="form-text">
    <label>{#INSCR_ONLINE#}</label>
        <select name="inscriptionOnline" id="InscriptionOnline" class="validate[optional]">
    {if (isset($personne)) AND ($personne->getInscriptionOnline() eq 1)}}<option value="1" selected="selected">{else}<option value="1">{/if}{#OUI#}</option>
{if (isset($personne)) AND ($personne->getInscriptionOnline() eq 0)}}<option value="0" selected="selected">{else}<option value="0">{/if}{#NON#}</option>
</select>

</fieldset>
{if !isset($personne)}

    <fieldset class="form-text">
        <label>{#ADRESSE1#} <em>*</em></label>
        <input type="text" name="adresseLigne1" id="adresse1" class="validate[required]"/>
    </fieldset>

    <fieldset class="form-text">
        <label>{#ADRESSE2#}</label>
        <input type="text" name="adresseLigne2" value=""/>
    </fieldset>

    <fieldset class="form-text break">
        <label>{#ADRESSE3#}</label>
        <input type="text" name="adresseLigne3" value=""/>
    </fieldset>

    <fieldset class="form-text">
        <label>{#NPA#} <em>*</em></label>
        <input type="text" name="npa" id="npa" class="validate[required,custom[onlyNumber],length[4,6]]"/>

    </fieldset>

    <fieldset class="form-text">
        <label>{#LOCALITE#}<em>*</em></label>
        <input type="text" name="localite" id="localite" class="validate[required,custom[onlyLetter],length[0,100]]"/>
    </fieldset>

    <fieldset class="form-text">
        <label>{#REGION#}</label>
        <input type="text" name="region" id="region" class="validate[optional,custom[onlyLetter],length[0,25]]"/>
    </fieldset>

    <fieldset class="form-text">
        <label>{#PAYS#}<em>*</em></label>
            <select name="pays" id="pays" class="validate[optional,length[0,100]]">
            <option value="">---</option>
                {if isset($listePays)}
                    {foreach from=$listePays item=pays}
                        <option value="{$pays->getNom()}">{$pays->getNom()}</option>
                    {/foreach}
                {/if}
            </select>
    </fieldset>
{/if}

<fieldset class="form-text long haut">
    <label>{#REMARQUE#}</label>
    <textarea name="remarque">{if isset($personne)}{$personne->getRemarque()}{/if}</textarea>
</fieldset>

<fieldset class="form-actions">
    <input type="reset" value="{#ANNULER#}" name="Annuler"  onclick="{literal};javascript:return confirm('{/literal}{#MESSAGE_ANNULER#}{literal}'){/literal}" />
{if isset($personne)}<input type="submit" class="submit" name="modifierPersonne" value="{#ENREGISTRER#}" />{else}<input type="submit" class="submit" name="ajouterPersonne" value="{#ENREGISTRER#}" />{/if}
</fieldset>
</form>                

</section>
